package com.xgxf.server.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xgxf.server.common.BaseQuery;
import com.xgxf.server.common.BaseServiceImpl;
import com.xgxf.server.common.JsonResult;
import com.xgxf.server.constant.StandardConstant;
import com.xgxf.server.mapper.ParameterDetailsMapper;
import com.xgxf.server.pojo.*;
import com.xgxf.server.service.IParameterDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;
import java.util.regex.Pattern;

@Service
public class ParameterDetailsServiceImpl extends BaseServiceImpl<ParameterDetailsMapper, ParameterDetails> implements IParameterDetailsService {

    @Autowired
    private ParameterDetailsMapper paMapper;

    @Override
    public JsonResult getList(BaseQuery parameterQuery) {
        IPage<ParameterDetails> iPage = new Page<>(parameterQuery.getPage(),parameterQuery.getLimit());
        IPage<ParameterDetails> pageData = paMapper.getList(iPage,parameterQuery);
        return JsonResult.success(pageData,"列表获取成功！");
    }

    /**
     * String[] ids
     * 传参名为id，实为type型号
     * @param ids
     * @return
     */
    @Override
    public JsonResult deleteId(int userId, String userName, String[] ids) {
        if (ids == null || ids.length <= 0) {
            return JsonResult.error("ID不能为空");
        }
        Integer totalNum = 0;
        for (String id : ids) {
            boolean result = paMapper.deleteId(id);
            if (result) {
                String scissorLiftType = id;
                // 生成删除日志
                UserOperationLog userDeleteLog = this.generateCreateAndDeleteLogs(userId, userName, scissorLiftType, StandardConstant.operationNameMap.get(3));
                // 保存删除日志
                paMapper.insertUserOperationLog(userDeleteLog);
                totalNum++;
            }
        }
        if (totalNum != ids.length) {
            return JsonResult.error("删除失败！");
        }
        return JsonResult.success("删除成功！");
    }

    @Override
    public JsonResult updateCondition(int userId, String userName, StandardValues params) {
        // 校验最大值最小值
        StandardValidationResult sVResult = this.FormValidation(params);

        if (sVResult.isFlag()) {
            // 获取修改前的标准值
            StandardValues previousStandard = this.getStandardValues(params.getType());
            // 执行修改操作
            boolean result = paMapper.updateForkLiftById(params);
            if (result) {
                // 获取修改后的标准值
                StandardValues modifiedStandard = params;

                // 生成修改日志
                List<UserOperationLog> userUpdateLogs = this.generateUpdateLogs(userId, userName, previousStandard, modifiedStandard);
                // 修改日志保存至数据库
                for (UserOperationLog userUpdateLog : userUpdateLogs) {
                    paMapper.insertUserOperationLog(userUpdateLog);
                }
                return JsonResult.success("更新成功！");
            }
            return JsonResult.error("更新失败！");
        }
        return JsonResult.error("输入数值不符合规定: " + sVResult.getMinName() + " 或 " + sVResult.getMaxName());
    }

    @Override
    public JsonResult insertForkLiftById(int userId, String userName, StandardValues params) {
        // 校验最大值最小值
        StandardValidationResult sVResult = this.FormValidation(params);

        if (sVResult.isFlag()) {
            try {
                boolean result = paMapper.insertForkLiftOnTypeDefine(params);
                if (result) {
                    paMapper.insertForkLiftONPINType(params);
                    paMapper.insertForkLiftOnStandardLimits(params);

                    String scissorLiftType = params.getType();

                    // 生成新增日志
                    UserOperationLog userCreateLog = this.generateCreateAndDeleteLogs(userId, userName, scissorLiftType, StandardConstant.operationNameMap.get(2));
                    // 保存新增日志
                    paMapper.insertUserOperationLog(userCreateLog);
                    return JsonResult.success("添加成功！");
                }
            } catch (Exception e) {
                e.printStackTrace();
                return JsonResult.error("添加失败，Type不能重复！");
            }
            return JsonResult.error("添加失败，请检查输入的值是否有误！");
        }
        return JsonResult.error("输入数值不符合规定: " + sVResult.getMinName() + " 或 " + sVResult.getMaxName());
    }

    @Override
    public JsonResult getTypeDetails(ParameterDetailsQuery parameterQuery) {
        IPage<ParameterDetails> iPage = new Page<>(parameterQuery.getPage(),parameterQuery.getLimit());
        IPage<ParameterDetails> pageData = paMapper.getTypeDetails(iPage,parameterQuery);
        return JsonResult.success(pageData,"型号获取成功！");
    }

    @Override
    public JsonResult getImportValues(String type) {
        StandardValues values = this.getStandardValues(type);
        values.setType("");
        values.setProductNo("");
        return JsonResult.success(values,"型号获取成功！");
    }


    // 获取具体型号剪叉车的标准值
    public StandardValues getStandardValues(String scissorLiftType){
        StandardValues standardValues = paMapper.getStandardValues(scissorLiftType);
        return standardValues;
    }

    /**
     * 获取本次修改操作的所有日志
     */
    public List<UserOperationLog> generateUpdateLogs(int userId, String userName, StandardValues previousStandard, StandardValues modifiedStandard){

        List<UserOperationLog> logs = new ArrayList<>();

        Double previousValue = 0.0;
        Double modifiedValue = 0.0;

        // 比较空载起最小作业高度最小值
        if (updateCompare(previousStandard.getEmptyupMinWorkHmin(), modifiedStandard.getEmptyupMinWorkHmin())){
            previousValue = previousStandard.getEmptyupMinWorkHmin();
            modifiedValue = modifiedStandard.getEmptyupMinWorkHmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(1)));
        }

        // 比较空载起最小作业高度最大值
        if (updateCompare(previousStandard.getEmptyupMinWorkHmax(), modifiedStandard.getEmptyupMinWorkHmax())){
            previousValue = previousStandard.getEmptyupMinWorkHmax();
            modifiedValue = modifiedStandard.getEmptyupMinWorkHmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(2)));
        }
        // 比较空载起最大作业高度最小值
        if (updateCompare(previousStandard.getEmptyupMaxWorkHmin(), modifiedStandard.getEmptyupMaxWorkHmin())){
            previousValue = previousStandard.getEmptyupMaxWorkHmin();
            modifiedValue = modifiedStandard.getEmptyupMaxWorkHmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(3)));
        }
        // 比较空载起最大作业高度最大值
        if (updateCompare(previousStandard.getEmptyupMaxWorkHmax(), modifiedStandard.getEmptyupMaxWorkHmax())){
            previousValue = previousStandard.getEmptyupMaxWorkHmax();
            modifiedValue = modifiedStandard.getEmptyupMaxWorkHmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(4)));
        }
        // 比较空载起最小电机控制电压最小值
        if (updateCompare(previousStandard.getEmptyupMinMotorVmin(), modifiedStandard.getEmptyupMinMotorVmin())){
            previousValue = previousStandard.getEmptyupMinMotorVmin();
            modifiedValue = modifiedStandard.getEmptyupMinMotorVmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(5)));
        }
        // 比较空载起最小电机控制电压最大值
        if (updateCompare(previousStandard.getEmptyupMinMotorVmax(), modifiedStandard.getEmptyupMinMotorVmax())){
            previousValue = previousStandard.getEmptyupMinMotorVmax();
            modifiedValue = modifiedStandard.getEmptyupMinMotorVmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(6)));
        }
        // 比较空载起最大电机控制电压最小值
        if (updateCompare(previousStandard.getEmptyupMaxMotorVmin(), modifiedStandard.getEmptyupMaxMotorVmin())){
            previousValue = previousStandard.getEmptyupMaxMotorVmin();
            modifiedValue = modifiedStandard.getEmptyupMaxMotorVmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(7)));
        }
        // 比较空载起最大电机控制电压最大值
        if (updateCompare(previousStandard.getEmptyupMaxMotorVmax(), modifiedStandard.getEmptyupMaxMotorVmax())){
            previousValue = previousStandard.getEmptyupMaxMotorVmax();
            modifiedValue = modifiedStandard.getEmptyupMaxMotorVmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(8)));
        }
        // 比较空载起最小压力最小值
        if (updateCompare(previousStandard.getEmptyupMinPmin(), modifiedStandard.getEmptyupMinPmin())){
            previousValue = previousStandard.getEmptyupMinPmin();
            modifiedValue = modifiedStandard.getEmptyupMinPmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(9)));
        }
        // 比较空载起最小压力最大值
        if (updateCompare(previousStandard.getEmptyupMinPmax(), modifiedStandard.getEmptyupMinPmax())){
            previousValue = previousStandard.getEmptyupMinPmax();
            modifiedValue = modifiedStandard.getEmptyupMinPmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(10)));
        }
        // 比较空载起最大压力最小值
        if (updateCompare(previousStandard.getEmptyupMaxPmin(), modifiedStandard.getEmptyupMaxPmin())){
            previousValue = previousStandard.getEmptyupMaxPmin();
            modifiedValue = modifiedStandard.getEmptyupMaxPmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(11)));
        }
        // 比较空载起最大压力最大值
        if (updateCompare(previousStandard.getEmptyupMaxPmax(), modifiedStandard.getEmptyupMaxPmax())){
            previousValue = previousStandard.getEmptyupMaxPmax();
            modifiedValue = modifiedStandard.getEmptyupMaxPmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(12)));
        }
        // 比较空载起平台偏摆量最小值
        if (updateCompare(previousStandard.getEmptyupOffsetmin(), modifiedStandard.getEmptyupOffsetmin())){
            previousValue = previousStandard.getEmptyupOffsetmin();
            modifiedValue = modifiedStandard.getEmptyupOffsetmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(13)));
        }
        // 比较空载起平台偏摆量最大值
        if (updateCompare(previousStandard.getEmptyupOffsetmax(), modifiedStandard.getEmptyupOffsetmax())){
            previousValue = previousStandard.getEmptyupOffsetmax();
            modifiedValue = modifiedStandard.getEmptyupOffsetmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(14)));
        }
        // 比较空载起最大振动量最小值
        if (updateCompare(previousStandard.getEmptyupMaxVibrationmin(), modifiedStandard.getEmptyupMaxVibrationmin())){
            previousValue = previousStandard.getEmptyupMaxVibrationmin();
            modifiedValue = modifiedStandard.getEmptyupMaxVibrationmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(15)));
        }
        // 比较空载起最大振动量最大值
        if (updateCompare(previousStandard.getEmptyupMaxVibrationmax(), modifiedStandard.getEmptyupMaxVibrationmax())){
            previousValue = previousStandard.getEmptyupMaxVibrationmax();
            modifiedValue = modifiedStandard.getEmptyupMaxVibrationmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(16)));
        }
        // 比较空载起坑洞检测最小值
        if (updateCompare(previousStandard.getEmptyupPitcheckmin(), modifiedStandard.getEmptyupPitcheckmin())){
            previousValue = previousStandard.getEmptyupPitcheckmin();
            modifiedValue = modifiedStandard.getEmptyupPitcheckmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(17)));
        }
        // 比较空载起坑洞检测最大值
        if (updateCompare(previousStandard.getEmptyupPitcheckmax(), modifiedStandard.getEmptyupPitcheckmax())){
            previousValue = previousStandard.getEmptyupPitcheckmax();
            modifiedValue = modifiedStandard.getEmptyupPitcheckmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(18)));
        }
        // 比较空载起升时间最小值
        if (updateCompare(previousStandard.getEmptyupLiftTmin(), modifiedStandard.getEmptyupLiftTmin())){
            previousValue = previousStandard.getEmptyupLiftTmin();
            modifiedValue = modifiedStandard.getEmptyupLiftTmin();
            logs.add(this.createUpdateLog(previousValue,modifiedValue, StandardConstant.modifiableNameMap.get(19)));
        }
        // 比较空载起升时间最大值
        if (updateCompare(previousStandard.getEmptyupLiftTmax(), modifiedStandard.getEmptyupLiftTmax())){
            previousValue = previousStandard.getEmptyupLiftTmax();
            modifiedValue = modifiedStandard.getEmptyupLiftTmax();
            logs.add(this.createUpdateLog(previousValue,modifiedValue, StandardConstant.modifiableNameMap.get(20)));
        }
        // 比较空载起最小电机电流最小值
        if (updateCompare(previousStandard.getEmptyupMinMotorCurrentMin(), modifiedStandard.getEmptyupMinMotorCurrentMin())){
            previousValue = previousStandard.getEmptyupMinMotorCurrentMin();
            modifiedValue = modifiedStandard.getEmptyupMinMotorCurrentMin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(21)));
        }
        // 比较空载起最小电机电流最大值
        if (updateCompare(previousStandard.getEmptyupMinMotorCurrentMax(), modifiedStandard.getEmptyupMinMotorCurrentMax())){
            previousValue = previousStandard.getEmptyupMinMotorCurrentMax();
            modifiedValue = modifiedStandard.getEmptyupMinMotorCurrentMax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(22)));
        }
        // 比较空载起最大电机电流最小值
        if (updateCompare(previousStandard.getEmptyupMaxMotorCurrentMin(), modifiedStandard.getEmptyupMaxMotorCurrentMin())){
            previousValue = previousStandard.getEmptyupMaxMotorCurrentMin();
            modifiedValue = modifiedStandard.getEmptyupMaxMotorCurrentMin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(23)));
        }
        // 比较空载起最大电机电流最大值
        if (updateCompare(previousStandard.getEmptyupMaxMotorCurrentMax(), modifiedStandard.getEmptyupMaxMotorCurrentMax())){
            previousValue = previousStandard.getEmptyupMaxMotorCurrentMax();
            modifiedValue = modifiedStandard.getEmptyupMaxMotorCurrentMax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(24)));
        }
        // 比较空载落下降阀最小电压最小值
        if (updateCompare(previousStandard.getEmptydownMinValveVmin(), modifiedStandard.getEmptydownMinValveVmin())){
            previousValue = previousStandard.getEmptydownMinValveVmin();
            modifiedValue = modifiedStandard.getEmptydownMinValveVmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(25)));
        }
        // 比较空载落下降阀最小电压最大值
        if (updateCompare(previousStandard.getEmptydownMinValveVmax(), modifiedStandard.getEmptydownMinValveVmax())){
            previousValue = previousStandard.getEmptydownMinValveVmax();
            modifiedValue = modifiedStandard.getEmptydownMinValveVmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(26)));
        }
        // 比较空载落下降阀最大电压最小值
        if (updateCompare(previousStandard.getEmptydownMaxValveVmin(), modifiedStandard.getEmptydownMaxValveVmin())){
            previousValue = previousStandard.getEmptydownMaxValveVmin();
            modifiedValue = modifiedStandard.getEmptydownMaxValveVmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(27)));
        }
        // 比较空载落下降阀最大电压最大值
        if (updateCompare(previousStandard.getEmptydownMaxValveVmax(), modifiedStandard.getEmptydownMaxValveVmax())){
            previousValue = previousStandard.getEmptydownMaxValveVmax();
            modifiedValue = modifiedStandard.getEmptydownMaxValveVmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(28)));
        }
        // 比较空载落最小压力最小值
        if (updateCompare(previousStandard.getEmptydownMinPmin(), modifiedStandard.getEmptydownMinPmin())){
            previousValue = previousStandard.getEmptydownMinPmin();
            modifiedValue = modifiedStandard.getEmptydownMinPmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(29)));
        }
        // 比较空载落最小压力最大值
        if (updateCompare(previousStandard.getEmptydownMinPmax(), modifiedStandard.getEmptydownMinPmax())){
            previousValue = previousStandard.getEmptydownMinPmax();
            modifiedValue = modifiedStandard.getEmptydownMinPmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(30)));
        }
        // 比较空载落最大压力最小值
        if (updateCompare(previousStandard.getEmptydownMaxPmin(), modifiedStandard.getEmptydownMaxPmin())){
            previousValue = previousStandard.getEmptydownMaxPmin();
            modifiedValue = modifiedStandard.getEmptydownMaxPmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(31)));
        }
        // 比较空载落最大压力最大值
        if (updateCompare(previousStandard.getEmptydownMaxPmax(), modifiedStandard.getEmptydownMaxPmax())){
            previousValue = previousStandard.getEmptydownMaxPmax();
            modifiedValue = modifiedStandard.getEmptydownMaxPmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(32)));
        }
        // 比较空载落安全高度最小值
        if (updateCompare(previousStandard.getEmptydownSafeHmin(), modifiedStandard.getEmptydownSafeHmin())){
            previousValue = previousStandard.getEmptydownSafeHmin();
            modifiedValue = modifiedStandard.getEmptydownSafeHmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(33)));
        }
        // 比较空载落安全高度最大值
        if (updateCompare(previousStandard.getEmptydownSafeHmax(), modifiedStandard.getEmptydownSafeHmax())){
            previousValue = previousStandard.getEmptydownSafeHmax();
            modifiedValue = modifiedStandard.getEmptydownSafeHmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(34)));
        }
        // 比较空载落最大振动量最小值
        if (updateCompare(previousStandard.getEmptydownMaxVibrationmin(), modifiedStandard.getEmptydownMaxVibrationmin())){
            previousValue = previousStandard.getEmptydownMaxVibrationmin();
            modifiedValue = modifiedStandard.getEmptydownMaxVibrationmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(35)));
        }
        // 比较空载落最大振动量最大值
        if (updateCompare(previousStandard.getEmptydownMaxVibrationmax(), modifiedStandard.getEmptydownMaxVibrationmax())){
            previousValue = previousStandard.getEmptydownMaxVibrationmax();
            modifiedValue = modifiedStandard.getEmptydownMaxVibrationmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(36)));
        }
        // 比较空载落坑洞检测最小值
        if (updateCompare(previousStandard.getEmptydownPitcheckmin(), modifiedStandard.getEmptydownPitcheckmin())){
            previousValue = previousStandard.getEmptydownPitcheckmin();
            modifiedValue = modifiedStandard.getEmptydownPitcheckmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(37)));
        }
        // 比较空载落坑洞检测最大值
        if (updateCompare(previousStandard.getEmptydownPitcheckmax(), modifiedStandard.getEmptydownPitcheckmax())){
            previousValue = previousStandard.getEmptydownPitcheckmax();
            modifiedValue = modifiedStandard.getEmptydownPitcheckmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(38)));
        }
        // 比较空载下降时间最小值
        if (updateCompare(previousStandard.getEmptydownLiftTmin(), modifiedStandard.getEmptydownLiftTmin())){
            previousValue = previousStandard.getEmptydownLiftTmin();
            modifiedValue = modifiedStandard.getEmptydownLiftTmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(39)));
        }
        // 比较空载下降时间最大值
        if (updateCompare(previousStandard.getEmptydownLiftTmax(), modifiedStandard.getEmptydownLiftTmax())){
            previousValue = previousStandard.getEmptydownLiftTmax();
            modifiedValue = modifiedStandard.getEmptydownLiftTmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(40)));
        }
        // 比较空载行走最大振动量最小值
        if (updateCompare(previousStandard.getEmptywalkMaxVibrationmin(), modifiedStandard.getEmptywalkMaxVibrationmin())){
            previousValue = previousStandard.getEmptywalkMaxVibrationmin();
            modifiedValue = modifiedStandard.getEmptywalkMaxVibrationmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(41)));
        }
        // 比较空载行走最大振动量最大值
        if (updateCompare(previousStandard.getEmptywalkMaxVibrationmax(), modifiedStandard.getEmptywalkMaxVibrationmax())){
            previousValue = previousStandard.getEmptywalkMaxVibrationmax();
            modifiedValue = modifiedStandard.getEmptywalkMaxVibrationmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(42)));
        }
        // 比较额载最小压力最小值
        if (updateCompare(previousStandard.getRatedUPMinPmin(), modifiedStandard.getRatedUPMinPmin())){
            previousValue = previousStandard.getRatedUPMinPmin();
            modifiedValue = modifiedStandard.getRatedUPMinPmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(43)));
        }
        // 比较额载最小压力最大值
        if (updateCompare(previousStandard.getRatedUPMinPmax(), modifiedStandard.getRatedUPMinPmax())){
            previousValue = previousStandard.getRatedUPMinPmax();
            modifiedValue = modifiedStandard.getRatedUPMinPmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(44)));
        }
        // 比较额载最大压力最小值
        if (updateCompare(previousStandard.getRatedUPMaxPmin(), modifiedStandard.getRatedUPMaxPmin())){
            previousValue = previousStandard.getRatedUPMaxPmin();
            modifiedValue = modifiedStandard.getRatedUPMaxPmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(45)));
        }
        // 比较额载最大压力最大值
        if (updateCompare(previousStandard.getRatedUPMaxPmax(), modifiedStandard.getRatedUPMaxPmax())){
            previousValue = previousStandard.getRatedUPMaxPmax();
            modifiedValue = modifiedStandard.getRatedUPMaxPmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(46)));
        }
        // 比较额载下沉量最小值
        if (updateCompare(previousStandard.getRatedUPSinkmin(), modifiedStandard.getRatedUPSinkmin())){
            previousValue = previousStandard.getRatedUPSinkmin();
            modifiedValue = modifiedStandard.getRatedUPSinkmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(47)));
        }
        // 比较额载下沉量最大值
        if (updateCompare(previousStandard.getRatedUPSinkmax(), modifiedStandard.getRatedUPSinkmax())){
            previousValue = previousStandard.getRatedUPSinkmax();
            modifiedValue = modifiedStandard.getRatedUPSinkmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(48)));
        }
        // 比较额载起升最大振动量最小值
        if (updateCompare(previousStandard.getRatedUPMaxVibrationmin(), modifiedStandard.getRatedUPMaxVibrationmin())){
            previousValue = previousStandard.getRatedUPMaxVibrationmin();
            modifiedValue = modifiedStandard.getRatedUPMaxVibrationmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(49)));
        }
        // 比较额载起升最大振动量最大值
        if (updateCompare(previousStandard.getRatedUPMaxVibrationmax(), modifiedStandard.getRatedUPMaxVibrationmax())){
            previousValue = previousStandard.getRatedUPMaxVibrationmax();
            modifiedValue = modifiedStandard.getRatedUPMaxVibrationmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(50)));
        }
        // 比较额载起升时间最小值
        if (updateCompare(previousStandard.getRatedUPLiftTmin(), modifiedStandard.getRatedUPLiftTmin())){
            previousValue = previousStandard.getRatedUPLiftTmin();
            modifiedValue = modifiedStandard.getRatedUPLiftTmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(51)));
        }
        // 比较额载起升时间最大值
        if (updateCompare(previousStandard.getRatedUPLiftTmax(), modifiedStandard.getRatedUPLiftTmax())){
            previousValue = previousStandard.getRatedUPLiftTmax();
            modifiedValue = modifiedStandard.getRatedUPLiftTmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(52)));
        }
        // 比较额载最小电机电流最小值
        if (updateCompare(previousStandard.getRatedupMinMotorCurrentMin(), modifiedStandard.getRatedupMinMotorCurrentMin())){
            previousValue = previousStandard.getRatedupMinMotorCurrentMin();
            modifiedValue = modifiedStandard.getRatedupMinMotorCurrentMin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(53)));
        }
        // 比较额载最小电机电流最大值
        if (updateCompare(previousStandard.getRatedupMinMotorCurrentMax(), modifiedStandard.getRatedupMinMotorCurrentMax())){
            previousValue = previousStandard.getRatedupMinMotorCurrentMax();
            modifiedValue = modifiedStandard.getRatedupMinMotorCurrentMax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(54)));
        }
        // 比较额载最大电机电流最小值
        if (updateCompare(previousStandard.getRatedupMaxMotorCurrentMin(), modifiedStandard.getRatedupMaxMotorCurrentMin())){
            previousValue = previousStandard.getRatedupMaxMotorCurrentMin();
            modifiedValue = modifiedStandard.getRatedupMaxMotorCurrentMin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(55)));
        }
        // 比较额载最大电机电流最大值
        if (updateCompare(previousStandard.getRatedupMaxMotorCurrentMax(), modifiedStandard.getRatedupMaxMotorCurrentMax())){
            previousValue = previousStandard.getRatedupMaxMotorCurrentMax();
            modifiedValue = modifiedStandard.getRatedupMaxMotorCurrentMax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(56)));
        }
        // 比较额载下降时间最小值
        if (updateCompare(previousStandard.getRateddownLiftTmin(), modifiedStandard.getRateddownLiftTmin())){
            previousValue = previousStandard.getRateddownLiftTmin();
            modifiedValue = modifiedStandard.getRateddownLiftTmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(57)));
        }
        // 比较额载下降时间最大值
        if (updateCompare(previousStandard.getRateddownLiftTmax(), modifiedStandard.getRateddownLiftTmax())){
            previousValue = previousStandard.getRateddownLiftTmax();
            modifiedValue = modifiedStandard.getRateddownLiftTmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(58)));
        }
        // 比较额载下降最大振动量最小值
        if (updateCompare(previousStandard.getRateddownMaxVibrationmin(), modifiedStandard.getRateddownMaxVibrationmin())){
            previousValue = previousStandard.getRateddownMaxVibrationmin();
            modifiedValue = modifiedStandard.getRateddownMaxVibrationmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(59)));
        }
        // 比较额载下降最大振动量最大值
        if (updateCompare(previousStandard.getRateddownMaxVibrationmax(), modifiedStandard.getRateddownMaxVibrationmax())){
            previousValue = previousStandard.getRateddownMaxVibrationmax();
            modifiedValue = modifiedStandard.getRateddownMaxVibrationmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(60)));
        }
        // 比较额载行走最大振动量最小值
        if (updateCompare(previousStandard.getRatedwalkMaxVibrationmin(), modifiedStandard.getRatedwalkMaxVibrationmin())){
            previousValue = previousStandard.getRatedwalkMaxVibrationmin();
            modifiedValue = modifiedStandard.getRatedwalkMaxVibrationmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(61)));
        }
        // 比较额载行走最大振动量最大值
        if (updateCompare(previousStandard.getRatedwalkMaxVibrationmax(), modifiedStandard.getRatedwalkMaxVibrationmax())){
            previousValue = previousStandard.getRatedwalkMaxVibrationmax();
            modifiedValue = modifiedStandard.getRatedwalkMaxVibrationmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(62)));
        }
        // 比较额载左转向时间最小值
        if (updateCompare(previousStandard.getRatedwalkTurnTimeLMin(), modifiedStandard.getRatedwalkTurnTimeLMin())){
            previousValue = previousStandard.getRatedwalkTurnTimeLMin();
            modifiedValue = modifiedStandard.getRatedwalkTurnTimeLMin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(63)));
        }
        // 比较额载左转向时间最大值
        if (updateCompare(previousStandard.getRatedwalkTurnTimeLMax(), modifiedStandard.getRatedwalkTurnTimeLMax())){
            previousValue = previousStandard.getRatedwalkTurnTimeLMax();
            modifiedValue = modifiedStandard.getRatedwalkTurnTimeLMax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(64)));
        }
        // 比较额载右转向时间最小值
        if (updateCompare(previousStandard.getRatedwalkTurnTimeRMin(), modifiedStandard.getRatedwalkTurnTimeRMin())){
            previousValue = previousStandard.getRatedwalkTurnTimeRMin();
            modifiedValue = modifiedStandard.getRatedwalkTurnTimeRMin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(65)));
        }
        // 比较额载右转向时间最大值
        if (updateCompare(previousStandard.getRatedwalkTurnTimeRMax(), modifiedStandard.getRatedwalkTurnTimeRMax())){
            previousValue = previousStandard.getRatedwalkTurnTimeRMax();
            modifiedValue = modifiedStandard.getRatedwalkTurnTimeRMax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(66)));
        }
        // 比较低空低速行驶速度最小值
        if (updateCompare(previousStandard.getClimbLowlowspeedmin(), modifiedStandard.getClimbLowlowspeedmin())){
            previousValue = previousStandard.getClimbLowlowspeedmin();
            modifiedValue = modifiedStandard.getClimbLowlowspeedmin();
            logs.add(this.createUpdateLog(previousValue,modifiedValue, StandardConstant.modifiableNameMap.get(67)));
        }
        // 比较低空低速行驶速度最大值
        if (updateCompare(previousStandard.getClimbLowlowspeedmax(), modifiedStandard.getClimbLowlowspeedmax())){
            previousValue = previousStandard.getClimbLowlowspeedmax();
            modifiedValue = modifiedStandard.getClimbLowlowspeedmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(68)));
        }
        // 比较低空高速行驶速度最小值
        if (updateCompare(previousStandard.getClimbLowhighspeedmin(), modifiedStandard.getClimbLowhighspeedmin())){
            previousValue = previousStandard.getClimbLowhighspeedmin();
            modifiedValue = modifiedStandard.getClimbLowhighspeedmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(69)));
        }
        // 比较低空高速行驶速度最大值
        if (updateCompare(previousStandard.getClimbLowhighspeedmax(), modifiedStandard.getClimbLowhighspeedmax())){
            previousValue = previousStandard.getClimbLowhighspeedmax();
            modifiedValue = modifiedStandard.getClimbLowhighspeedmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(70)));
        }
        // 比较高空低速行驶速度最小值
        if (updateCompare(previousStandard.getClimbHighhighspeedmin(), modifiedStandard.getClimbHighhighspeedmin())){
            previousValue = previousStandard.getClimbHighhighspeedmin();
            modifiedValue = modifiedStandard.getClimbHighhighspeedmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(71)));
        }
        // 比较高空低速行驶速度最大值
        if (updateCompare(previousStandard.getClimbHighhighspeedmax(), modifiedStandard.getClimbHighhighspeedmax())){
            previousValue = previousStandard.getClimbHighhighspeedmax();
            modifiedValue = modifiedStandard.getClimbHighhighspeedmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(72)));
        }
        // 比较低速刹车距离最小值
        if (updateCompare(previousStandard.getLowbrakingDistanceMin(), modifiedStandard.getLowbrakingDistanceMin())){
            previousValue = previousStandard.getLowbrakingDistanceMin();
            modifiedValue = modifiedStandard.getLowbrakingDistanceMin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(73)));
        }
        // 比较低速刹车距离最大值
        if (updateCompare(previousStandard.getLowbrakingDistanceMax(), modifiedStandard.getLowbrakingDistanceMax())){
            previousValue = previousStandard.getLowbrakingDistanceMax();
            modifiedValue = modifiedStandard.getLowbrakingDistanceMax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(74)));
        }
        // 比较高速刹车距离最小值
        if (updateCompare(previousStandard.getHighbrakingDistanceMin(), modifiedStandard.getHighbrakingDistanceMin())){
            previousValue = previousStandard.getHighbrakingDistanceMin();
            modifiedValue = modifiedStandard.getHighbrakingDistanceMin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(75)));
        }
        // 比较高速刹车距离最大值
        if (updateCompare(previousStandard.getHighbrakingDistanceMax(), modifiedStandard.getHighbrakingDistanceMax())){
            previousValue = previousStandard.getHighbrakingDistanceMax();
            modifiedValue = modifiedStandard.getHighbrakingDistanceMax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(76)));
        }
        // 高空低速刹车距离最小值
        if (updateCompare(previousStandard.getHighlowbrakingDistanceMin(), modifiedStandard.getHighlowbrakingDistanceMin())){
            previousValue = previousStandard.getHighlowbrakingDistanceMin();
            modifiedValue = modifiedStandard.getHighlowbrakingDistanceMin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(77)));
        }
        // 高空低速刹车距离最大值
        if (updateCompare(previousStandard.getHighlowbrakingDistanceMax(), modifiedStandard.getHighlowbrakingDistanceMax())){
            previousValue = previousStandard.getHighlowbrakingDistanceMax();
            modifiedValue = modifiedStandard.getHighlowbrakingDistanceMax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(78)));
        }
        // 爬坡高空低速行驶速度最小值
        if (updateCompare(previousStandard.getClimbHighlowspeedmin(), modifiedStandard.getClimbHighlowspeedmin())){
            previousValue = previousStandard.getClimbHighlowspeedmin();
            modifiedValue = modifiedStandard.getClimbHighlowspeedmin();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(79)));
        }
        // 爬坡高空低速行驶速度最大值
        if (updateCompare(previousStandard.getClimbHighlowspeedmax(), modifiedStandard.getClimbHighlowspeedmax())){
            previousValue = previousStandard.getClimbHighlowspeedmax();
            modifiedValue = modifiedStandard.getClimbHighlowspeedmax();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(80)));
        }
        // 比较整机长度
        if (updateCompare(previousStandard.getProductOverallLength(), modifiedStandard.getProductOverallLength())){
            previousValue = previousStandard.getProductOverallLength();
            modifiedValue = modifiedStandard.getProductOverallLength();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(81)));
        }
        // 比较整机宽度
        if (updateCompare(previousStandard.getProductOverallWidth(), modifiedStandard.getProductOverallWidth())){
            previousValue = previousStandard.getProductOverallWidth();
            modifiedValue = modifiedStandard.getProductOverallWidth();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(82)));
        }
        // 比较整机高度
        if (updateCompare(previousStandard.getProductOverallHeight(), modifiedStandard.getProductOverallHeight())){
            previousValue = previousStandard.getProductOverallHeight();
            modifiedValue = modifiedStandard.getProductOverallHeight();
            logs.add(this.createUpdateLog(previousValue, modifiedValue, StandardConstant.modifiableNameMap.get(83)));
        }

        // 为每条记录添加其他信息
        for (UserOperationLog updateLog: logs){
            updateLog.setUserId(userId);
            updateLog.setUserName(userName);
            updateLog.setScissorLiftType(previousStandard.getType());
            updateLog.setOperationType(StandardConstant.operationNameMap.get(1));
            updateLog.setOperationTime(this.getNowDateTime());
        }
        return logs;
    }

    // 生成添加和删除操作日志
    public UserOperationLog generateCreateAndDeleteLogs(int userId, String userName, String scissorLiftType, String operationType){
        UserOperationLog log = new UserOperationLog();
        log.setUserId(userId);
        log.setUserName(userName);
        log.setStandardName(scissorLiftType + "的所有检测标准");
        log.setScissorLiftType(scissorLiftType);
        log.setOperationType(operationType);
        log.setOperationTime(this.getNowDateTime());
        return log;
    }

    // 获取现在时间（精确到秒而不是毫秒）
    public Date getNowDateTime() {
        Calendar calendar = Calendar.getInstance();
        // 将毫秒数设为0
        calendar.set(Calendar.MILLISECOND,0);
        Date nowDate = calendar.getTime();
        return nowDate;
    }


    // 比较修改前后标准值是否相同
    public boolean updateCompare(Double previousValue, Double modifiedValue){
        if(!String.valueOf(previousValue).equals(String.valueOf(modifiedValue))){
            return true;
        }
        return false;
    }
    
    // 生成修改操作日志
    public UserOperationLog createUpdateLog(Double previousValue, Double modifiedValue, String standardName){
        UserOperationLog updateLog = new UserOperationLog();
        updateLog.setPreviousValue(previousValue);
        updateLog.setModifiedValue(modifiedValue);
        updateLog.setStandardName(standardName);
        return updateLog;
    }

    // 校验整个表单最大值最小值情况
    public StandardValidationResult FormValidation(StandardValues values){
        // 获取检测标准对应的最值map
        Map<Integer, Double> map = this.convertStandardToMap(values);
        // 返回校验结果
        StandardValidationResult sVResult = new StandardValidationResult();
        // 初始化flag
        boolean flag;

        // 输入数值不为非负浮点数，未通过校验即返回false
        Pattern pattern = Pattern.compile("^\\d+(\\.\\d+)?$");

        for (int i = 1; i < map.size(); i++) {
            // 判断输入数值是否为非负浮点数
            flag = pattern.matcher(String.valueOf(map.get(i))).matches();
            if(!flag){
                sVResult.setFlag(false);
                sVResult.setMinName(StandardConstant.modifiableNameMap.get(i));
                sVResult.setMaxName(StandardConstant.modifiableNameMap.get(i));
                return sVResult;
            }
        }

        int j = 0;
        // 任何检测项的标准最大最小值未通过校验即返回false
        for (int i = 1; i <= (map.size() - 4); i+=2) {
            j = i + 1;
            flag = this.MaxAndMinValidation(map.get(i), map.get(j));
            if(!flag){
                sVResult.setFlag(false);
                sVResult.setMinName(StandardConstant.modifiableNameMap.get(i));
                sVResult.setMaxName(StandardConstant.modifiableNameMap.get(j));
                return sVResult;
            }
        }

        // 判断整机长宽高是否大于0
        for (int i = (map.size() - 2); i <= map.size() ; i++) {
            flag = map.get(i) > 0;
            if(!flag){
                sVResult.setFlag(false);
                sVResult.setMinName(StandardConstant.modifiableNameMap.get(i));
                sVResult.setMaxName(StandardConstant.modifiableNameMap.get(i));
                return sVResult;
            }
        }
        sVResult.setFlag(true);
        return sVResult;
    }

    // 校验单组标准的最大值最小值
    public boolean MaxAndMinValidation(double minValue, double maxValue){
        if(minValue < 0 || maxValue < 0 || maxValue < minValue){
            return false;
        }
        return true;
    }

    // 将检测标准的最大最小值分组存入Map中
    public Map<Integer,Double> convertStandardToMap(StandardValues values){
        Map<Integer,Double> map = new HashMap<Integer,Double>();

        // 空载起最小作业高度
        map.put(1,values.getEmptyupMinWorkHmin());
        map.put(2,values.getEmptyupMinWorkHmax());

        // 空载起最大作业高度
        map.put(3,values.getEmptyupMaxWorkHmin());
        map.put(4,values.getEmptyupMaxWorkHmax());

        // 空载起最小电机控制电压
        map.put(5,values.getEmptyupMinMotorVmin());
        map.put(6,values.getEmptyupMinMotorVmax());

        // 空载起最大电机控制电压
        map.put(7,values.getEmptyupMaxMotorVmin());
        map.put(8,values.getEmptyupMaxMotorVmax());

        // 空载起最小压力
        map.put(9,values.getEmptyupMinPmin());
        map.put(10,values.getEmptyupMinPmax());

        // 空载起最大压力
        map.put(11,values.getEmptyupMaxPmin());
        map.put(12,values.getEmptyupMaxPmax());

        // 空载起平台偏摆量
        map.put(13,values.getEmptyupOffsetmin());
        map.put(14,values.getEmptyupOffsetmax());

        // 空载起最大振动量
        map.put(15,values.getEmptyupMaxVibrationmin());
        map.put(16,values.getEmptyupMaxVibrationmax());

        // 空载起坑洞检测结果
        map.put(17,values.getEmptyupPitcheckmin());
        map.put(18,values.getEmptyupPitcheckmax());

        // 空载起升时间
        map.put(19,values.getEmptyupLiftTmin());
        map.put(20,values.getEmptyupLiftTmax());

        // 空载起最小电机电流
        map.put(21,values.getEmptyupMinMotorCurrentMin());
        map.put(22,values.getEmptyupMinMotorCurrentMax());

        // 空载起最大电机电流
        map.put(23,values.getEmptyupMaxMotorCurrentMin());
        map.put(24,values.getEmptyupMaxMotorCurrentMax());

        // 空载落下降阀最小电压
        map.put(25,values.getEmptydownMinValveVmin());
        map.put(26,values.getEmptydownMinValveVmax());

        // 空载落下降阀最大电压
        map.put(27,values.getEmptydownMaxValveVmin());
        map.put(28,values.getEmptydownMaxValveVmax());

        // 空载落最小压力
        map.put(29,values.getEmptydownMinPmin());
        map.put(30,values.getEmptydownMinPmax());

        // 空载落最大压力
        map.put(31,values.getEmptydownMaxPmin());
        map.put(32,values.getEmptydownMaxPmax());

        // 空载落安全高度
        map.put(33,values.getEmptydownSafeHmin());
        map.put(34,values.getEmptydownSafeHmax());

        // 空载落最大振动量
        map.put(35,values.getEmptydownMaxVibrationmin());
        map.put(36,values.getEmptydownMaxVibrationmax());

        // 空载落坑洞检测结果
        map.put(37,values.getEmptydownPitcheckmin());
        map.put(38,values.getEmptydownPitcheckmax());

        // 空载下降时间
        map.put(39,values.getEmptydownLiftTmin());
        map.put(40,values.getEmptydownLiftTmax());

        // 空载行走最大振动量
        map.put(41,values.getEmptywalkMaxVibrationmin());
        map.put(42,values.getEmptywalkMaxVibrationmax());

        // 额载最小压力
        map.put(43,values.getRatedUPMinPmin());
        map.put(44,values.getRatedUPMinPmax());

        // 额载最大压力
        map.put(45,values.getRatedUPMaxPmin());
        map.put(46,values.getRatedUPMaxPmax());

        // 额载下沉量
        map.put(47,values.getRatedUPSinkmin());
        map.put(48,values.getRatedUPSinkmax());

        // 额载起升最大振动量
        map.put(49,values.getRatedUPMaxVibrationmin());
        map.put(50,values.getRatedUPMaxVibrationmax());

        // 额载起升时间
        map.put(51,values.getRatedUPLiftTmin());
        map.put(52,values.getRatedUPLiftTmax());

        // 额载最小电机电流
        map.put(53,values.getRatedupMinMotorCurrentMin());
        map.put(54,values.getRatedupMinMotorCurrentMax());

        // 额载最大电机电流
        map.put(55,values.getRatedupMaxMotorCurrentMin());
        map.put(56,values.getRatedupMaxMotorCurrentMax());

        // 额载下降时间
        map.put(57,values.getRateddownLiftTmin());
        map.put(58,values.getRateddownLiftTmax());

        // 额载下降最大振动量
        map.put(59,values.getRateddownMaxVibrationmin());
        map.put(60,values.getRateddownMaxVibrationmax());

        // 额载行走最大振动量
        map.put(61,values.getRatedwalkMaxVibrationmin());
        map.put(62,values.getRatedwalkMaxVibrationmax());

        // 额载左转向时间
        map.put(63,values.getRatedwalkTurnTimeLMin());
        map.put(64,values.getRatedwalkTurnTimeLMax());

        // 额载右转向时间
        map.put(65,values.getRatedwalkTurnTimeRMin());
        map.put(66,values.getRatedwalkTurnTimeRMax());

        // 低空低速行驶速度
        map.put(67,values.getClimbLowlowspeedmin());
        map.put(68,values.getClimbLowlowspeedmax());

        // 低空高速行驶速度
        map.put(69,values.getClimbLowhighspeedmin());
        map.put(70,values.getClimbLowhighspeedmax());

        // 高空低速行驶速度
        map.put(71,values.getClimbHighhighspeedmin());
        map.put(72,values.getClimbHighhighspeedmax());

        // 低速刹车距离
        map.put(73,values.getLowbrakingDistanceMin());
        map.put(74,values.getLowbrakingDistanceMax());

        // 高速刹车距离
        map.put(75,values.getHighbrakingDistanceMin());
        map.put(76,values.getHighbrakingDistanceMax());

        // 高空低速刹车距离
        map.put(77,values.getHighlowbrakingDistanceMin());
        map.put(78,values.getHighlowbrakingDistanceMax());

        // 爬坡高空低速行驶速度
        map.put(79,values.getClimbHighlowspeedmin());
        map.put(80,values.getClimbHighlowspeedmax());

        // 整机长宽高
        map.put(81,values.getProductOverallLength());
        map.put(82,values.getProductOverallWidth());
        map.put(83,values.getProductOverallHeight());

        return map;

    }

    @Override
    public ArrayList getParameterTypeList() {
        ArrayList<String> list = paMapper.getParameterTypeList();
        return list;
    }

}